<template>
  <view>
    授权成功
    <view>返回账号管理页面</view>
  </view>
</template>


<script>

const API = require('../../../utils/api/douyin.js').default;
const $ = require('../../../utils/api.js');


export default {
  name: "index",
  data() {
    return {
      type: null,
    }
  },
  onLoad: function() {

  },
  created() {

    this.code = this.$route.query.code;
    this.type = this.$route.query.state;
    this.getUserInfoByCode(this.code,this.type)
  },
  methods: {
    getUserInfoByCode(code,type) {
      const self = this;
      $.ajax({
        url: API.getUserInfoByCode,
        data: {
          code: code,
          type: type
        },
        method: 'GET',
        success(res) {
          //授权完成
          $.$toast("授权成功");
          $.go('/pagesA/thirdAccount/index?type=1', 2, 2000)
        }
      });
    },
  },
}
</script>


<style scoped>

</style>
